# def sum(x,y):
#     z = x + y
#     print("加法运算:{} + {} = {}".format(x,y,z))
#     return  x + y,x * y
#
#
# aa = sum(7,8)
# print("aa is {}".format(aa))
# cc,dd = sum(7,8)
# print("cc is {} dd is {}".format(cc,dd))


# bb = lambda x,y,z:x * y * z
# print(bb(7,8,9),type(bb))


x = 10
y = 20
s = "dengjianguo"
def changsha():
    global x
    x = 100
    z = 200
    print("x is {}".format(x))
    def nongda():
        global x
        nonlocal  z
        z = 400
        x = 300
        print("x is {} z is {} y is {}".format(x,z,y))
        print("模块名字是{}".format(__name__))
        print("邓建国字符串长度是{}".format(len(s)))
    nongda()
    print("z is {}".format(z))

if __name__ == "__main__":
    changsha()
    print("x is {}".format(x))










